package lab02.test19;

/**
 * Created by mac on 2017/11/1.
 */
public class Test {

    public static void main(String[] args) {

        //实现字符串的大小写转换并倒序输出
        //hELLOwORLD
        String result = "HelloWorld";

        //

        char tmp;
        int i;
        for (i=0;i<result.length();i++){

            tmp = result.charAt(i);

            if (tmp>='A' && tmp<='Z'){

                System.out.println((char)(tmp + 32));
            }
            else if (tmp<='a' && tmp<='z'){

                System.out.println((char)(tmp-32));
            }

        }

        System.out.println("\n");
        String Str = "hELLOwORLD";
        StringBuilder sb = new StringBuilder(Str);
        System.out.println(sb.reverse().toString());


    }


}
